<div bind-notifier="{ rebind:formData.useRelative }">

  <ion-item class="item-icon-left item-text-wrap visible-xs visible-sm">
    <i class="icon ion-android-bookmark"></i>
    <span translate>CURRENCY.VIEW.CURRENCY_NAME</span>
    <div class="item-note dark" ng-if="!loading">
      {{formData.currency}} (<span ng-bind-html=":rebind:formData.currency | currencySymbol:formData.useRelative"></span>)
    </div>
  </ion-item>

  <ion-item id="helptip-currency-mass-member" class="item-icon-left item-text-wrap">
    <i class="icon ion-pie-graph"></i>
    <div class="col col-60">
      <span translate>CURRENCY.VIEW.SHARE</span>
      <span class="gray">(M<sub>t</sub>/N<sub>t</sub>)</span>
    </div>
    <span id="helptip-currency-mass-member-unit"
          ng-if="!loading"
          class="badge badge-calm"
          ng-bind-html=":rebind:formData.MoverN | formatAmount:{currency: formData.currency, useRelative: formData.useRelative, currentUD: formData.currentUD}">
    </span>
  </ion-item>

  <ion-item class="item-icon-left item-text-wrap">
    <i class="icon ion-record"></i>
    <div class="col col-60">
      <span translate>CURRENCY.VIEW.MASS</span>
      <span class="gray">(M<sub>t</sub>)</span>
    </div>
    <span class="badge badge-energized"
          ng-if="!loading"
          ng-bind-html=":rebind:formData.M | formatAmount:{currency: formData.currency, useRelative: formData.useRelative, currentUD: formData.currentUD}"></span>
  </ion-item>

  <!-- Allow extension here -->
  <cs-extension-point name="parameters-actual"></cs-extension-point>


  <ion-item class="item-icon-left item-text-wrap">
    <i class="icon ion-arrow-graph-up-right"></i>
    <div class="col col-60">
      <span translate>CURRENCY.VIEW.C_ACTUAL</span>
      <span class="gray">(c<sub>{{'CURRENCY.VIEW.CURRENT'|translate}}</sub>)</span>
    </div>
    <span class="badge badge-stable">{{formData.cactual | formatNumeral: '0,0.00'}} %&nbsp;/&nbsp;{{formData.dt | formatPeriod}}</span>
  </ion-item>


  <ion-item class="item-icon-left item-text-wrap">
    <i class="icon ion-load-c"></i>
    <div class="col col-60">
      <span translate>CURRENCY.VIEW.UD</span>
      <span class="gray">({{'COMMON.UD'|translate}}<sub>t</sub>)</span>
    </div>
    <div class="badge badge-royal" ng-if="!loading">
      <span ng-if="formData.useRelative">
        1 <ng-bind-html ng-bind-html=":rebind:formData.currency| currencySymbol:true"></ng-bind-html>
      </span>
      <span ng-if="!formData.useRelative"
            ng-bind-html=":rebind:formData.currentUD | formatAmount:{currency: formData.currency, useRelative: formData.useRelative, currentUD: formData.currentUD}">
      </span>
      &nbsp;/&nbsp;{{formData.dt | formatPeriod}}
    </div>
  </ion-item>

  <div class="item item-toggle dark">
    <div class="item-label text-right gray" translate>COMMON.BTN_RELATIVE_UNIT</div>
    <label class="toggle toggle-royal" id="helptip-currency-change-unit">
      <input type="checkbox" ng-model="formData.useRelative">
      <div class="track">
        <div class="handle"></div>
      </div>
    </label>
  </div>


  <a name="helptip-currency-rules-anchor"></a>
  <div class="item item-divider" id="helptip-currency-rules">
    <span translate>CURRENCY.VIEW.MONEY_RULES_DIVIDER</span>
  </div>

  <ion-item class="item-icon-left item-text-wrap">
    <i class="icon ion-arrow-graph-up-right"></i>
    <div class="col col-60">
      <span translate>CURRENCY.VIEW.C_RULE</span>
      <span class="gray">(c)</span>
    </div>
    <!-- compat with Duniter 0.90 -->
    <span class="item-note dark" ng-if="!loading && !formData.udReevalTime0">{{formData.c*100 | formatNumeral: '0,0.00'}} %&nbsp;/&nbsp;{{formData.dt | formatPeriod}}</span>
    <!-- Duniter 1.0+ -->
    <span class="badge badge-stable" ng-if="!loading && formData.udReevalTime0">{{formData.c*100 | formatNumeral: '0,0.00'}} %&nbsp;/&nbsp;{{formData.dtReeval | formatDuration}}</span>
  </ion-item>

  <!-- only Duniter 1.0+ -->
  <ion-item class="item-icon-left item-text-wrap" ng-if="formData.udReevalTime0 && formData.allRules">
    <i class="icon ion-load-c"></i>
    <b class="ion-clock icon-secondary" style="font-size: 18px; left: 36px; top: -12px;"></b>
    <div class="col col-60">
      <span translate>CURRENCY.VIEW.DT_REEVAL</span>
      <span class="gray">(dt<sub>{{'CURRENCY.VIEW.REEVAL_SYMBOL'|translate}}</sub>)</span>
    </div>
    <span class="item-note dark" ng-if="!loading"
          translate="CURRENCY.VIEW.DT_REEVAL_VALUE"
          translate-values="formData">
    </span>
  </ion-item>

  <!-- only Duniter 1.0+ -->
  <ion-item class="item-icon-left item-text-wrap" ng-if="formData.udReevalTime0 && formData.allRules">
    <i class="icon ion-load-c"></i>
    <b class="ion-calendar icon-secondary" style="font-size: 18px; left: 36px; top: -12px;"></b>
    <div class="col col-60">
      <span translate>CURRENCY.VIEW.UD_REEVAL_TIME0</span>
      <span class="gray">(t0<sub>{{'CURRENCY.VIEW.REEVAL_SYMBOL'|translate}}</sub>)</span>
    </div>
    <span class="item-note dark" ng-if="!loading">{{formData.udReevalTime0|medianDate}}
    </span>
  </ion-item>

  <ion-item  class="item-icon-left item-text-wrap" ng-if="formData.allRules">
    <i class="icon ion-load-c"></i>
    <b class="ion-calculator icon-secondary" style="font-size: 18px; left: 36px; top: -12px;"></b>
    <div class="col col-60">
      <span translate>CURRENCY.VIEW.UD_RULE</span>
      <span class="gray" ng-if="formData.udReevalTime0">- {{'COMMON.UD'|translate}}<sub>{{formData.dt|formatPeriod}}</sub>(t<sub>{{'CURRENCY.VIEW.REEVAL_SYMBOL'|translate}}</sub>)</span>
    </div>
    <!-- compat with Duniter 0.90 -->
    <span class="item-note dark" ng-if="!loading && !formData.udReevalTime0">{{'COMMON.UD'|translate}}<sub>t-1</sub> + c<sup>2</sup> * M<sub>t-1</sub>/N<sub>t-1</sub></span>
    <!-- Duniter 1.0+ -->
    <span class="item-note dark" ng-if="!loading && formData.udReevalTime0">{{'COMMON.UD'|translate}}<sub>{{formData.dt|formatPeriod}}</sub>(t<sub>{{'CURRENCY.VIEW.REEVAL_SYMBOL'|translate}}</sub> - dt<sub>{{'CURRENCY.VIEW.REEVAL_SYMBOL'|translate}}</sub>)+ c<sup>2</sup> * (M/N)(t<sub>{{'CURRENCY.VIEW.REEVAL_SYMBOL'|translate}}</sub> - dt<sub>{{'CURRENCY.VIEW.REEVAL_SYMBOL'|translate}}</sub>) / dt<sub>{{'CURRENCY.VIEW.REEVAL_SYMBOL'|translate}}</sub></span>
  </ion-item>

  <div class="item item-toggle dark">
    <div class="item-label text-right gray" translate>CURRENCY.VIEW.DISPLAY_ALL_RULES</div>
    <label class="toggle toggle-royal">
      <input type="checkbox" ng-model="formData.allRules">
      <div class="track">
        <div class="handle"></div>
      </div>
    </label>
  </div>

</div>
